// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.enums;

/**
 * 消息内容类型枚举
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2023-02-20
 */
public enum MessageContentTypeEnum {
    TEXT(1, "文本"),
    IMAGE(2, "图片"),
    VOICE(3, "语音"),
    VIDEO(4, "视频"),
    FILE(5, "文件"),
    TEXT_CARD(6, "文本卡片"),
    IMAGE_TEXT(7, "图文"),
    MP_NEWS(8, "mpnews消息"),
    MARK_DOWN(9, "markdown消息"),
    MINI_PROGRAM_NOTICE(10, "小程序通知"),
    TEMPLATE_CARD(11, "模板卡片");

    private int value;

    private String name;

    MessageContentTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getNameByValue(int value) {
        MessageContentTypeEnum arrObj[] = MessageContentTypeEnum.values();
        for (MessageContentTypeEnum obj : arrObj) {
            if (value == obj.getValue()) {
                return obj.getName();
            }
        }
        return " ";
    }
}
